﻿Imports DTO
Imports System.Data.SqlClient


Public Class DauSach_DAO
    Public Shared Function getMaDauSach(ByVal masach As Integer) As Integer
        Dim con As SqlConnection = DataProvider.ConnectToDB
        Dim cmd As New SqlCommand
        cmd.CommandType = CommandType.StoredProcedure
        cmd.CommandText = "DauSach_GetMaDauSach"
        cmd.Connection = con

        Dim para As New SqlParameter("masach", SqlDbType.Int)
        para.Direction = ParameterDirection.Input
        para.Value = masach
        cmd.Parameters.Add(para)

        para = New SqlParameter("madausach", SqlDbType.Int)
        para.Direction = ParameterDirection.Output
        cmd.Parameters.Add(para)

        cmd.ExecuteNonQuery()

        Return cmd.Parameters("madausach").Value

    End Function
End Class
